<!--
 * @Description: 
 * @Author: charles
 * @Date: 2021-05-05 22:02:56
 * @LastEditors: lalahahababa
 * @LastEditTime: 2022-01-07 18:28:44
-->
<template>
  <!--1. 容器 -->
  <div ref="bottom2_container" style="height: 95%"></div>
</template>


<script>
import { Bar } from '@antv/g2plot';

export default {
      data(){
        return{
          dataArr:[
          { year: '1951 年', value: 38 },
  { year: '1952 年', value: 52 },
  { year: '1956 年', value: 61 },
  { year: '1957 年', value: 145 },
  { year: '1958 年', value: 48 },
        ]
        }
    },
    created(){


    },
    mounted(){
      this.initChart()

      },
      methods:{
        initChart() {
          const bar =new Bar(this.$refs.bottom2_container, {
            data:this.dataArr,
             xField: 'year',
             yField: 'value',
             seriesField: 'year',
             legend: {
    position: 'top-left',
  },
          });
          bar.render();

        }

      }
}

</script>


<style scoped>

</style>